/*
 * @Author: 秦福凯
 * @LastEditTime: 2025-05-22 09:26:07
 * @Description: 配置项
 */

import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import VueSetupExtend from 'vite-plugin-vue-setup-extend';
import AutoImport from 'unplugin-auto-import/vite';
import Components from 'unplugin-vue-components/vite';
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers';

export default defineConfig({
	base: './',
	plugins: [
		vue(),
		VueSetupExtend(),
		AutoImport({
			imports: ['vue'],
			resolvers: [
				ElementPlusResolver()
			]
		}),
		Components({
			resolvers: [ElementPlusResolver()]
		})
	],
	optimizeDeps: {
		include: ['schart.js'],

	},
	resolve: {
		alias: {
			'@': '/src',
			'~': '/src/assets'
		}
	},
	// 代理服务器配置
	server: {
		port: 9999,
		host: true,
		open: false,
		proxy: {
			// '/dev': {
			// 	target: 'http://192.168.124.9:8040/portal',
			// 	// target: 'http://219.151.178.60:8040/portal',//测试服务器
			// 	changeOrigin: true,
			// 	rewrite: (p) => p.replace(/^\/dev/, '')
			// }
		}
	},
	define: {
		__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: "true",
	},
});
